//
//  YQBasicTableViewController.swift
//  WeiBO
//
//  Created by a on 16/2/29.
//  Copyright © 2016年 xinji. All rights reserved.
//

import UIKit

class YQBasicTableViewController: UITableViewController,YQVisivtorViewdelegate{

    var visitor:YQVisivtorView?
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        visitor = YQVisivtorView()
        
        view = visitor
        
        //设置代理
        visitor?.delegate = self
        
        //设置导航栏
        setUpNav()

    }
    
    func setUpNav(){
        
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.Plain, target: self, action: "didRegister")
        
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: UIBarButtonItemStyle.Plain, target: self, action: "didLogin")
    
    }
    
    
///  代理方法
    ///登陆的跳转
    func didLogin() {
        
        
//        print("==login==")
    }
    
    func didRegister() {
        
        let loginVC = YQLoginViewController()
        
        let nav = UINavigationController(rootViewController: loginVC)
        
        presentViewController(nav, animated: true) { () -> Void in
            
        }
        
        
//        print("==register==")
        
    }
    
}
